from Claim import Claim
from create_data_sets import DatasetAcess

data = DatasetAcess()
#data.create_new_data_sets()
training = data.get_training_set()
training.extend( data.get_validation_set() )
n = len(Claim.vocabulary)

output = open('dataset_for_libsvm.tab','w')

for claim in training:
	output.write( str(claim.get_numerical_category()))
	output.write(' ')
	sparse = claim.sparse_data()
	keys = sparse.keys()
	keys.sort()
	for index in keys:
		output.write(str(index+2)+':'+str(sparse[index])+' ')
	output.write('\n')

output.close()
